package com.jquest.data;

import org.newdawn.slick.Image;
import org.newdawn.slick.Graphics;
import com.jquest.collision.CollisionMask;
import com.jquest.misc.SpriteSet;

/**
 * Created by IntelliJ IDEA.
 * User: Johan
 * Date: 2009-dec-11
 * Time: 17:30:03
 * To change this template use File | Settings | File Templates.
 */
public class Sprite implements Renderable {

    private int imgIdx;
    private int x, y;

    private CollisionMask mask;

    public Sprite(int x, int y, int imgIdx) {
        this.imgIdx = imgIdx;
        this.x = x;
        this.y = y;
    }

    public Image getImage() {
        return SpriteSet.get(imgIdx);
    }

    public int getSpriteIndex() {
        return imgIdx;
    }

    public int getX() {
        return x;
    }

    public int getY() {
        return y;
    }

    public void update(int time) {

    }

    public void render(Graphics g, Object attachment) {
        g.drawImage(SpriteSet.get(imgIdx), x, y);
    }

}
